package com.chaoyue.content.feignclient;


import com.chaoyue.content.config.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author whr
 * @version 1.0
 * @description: 远程调用media-api的上传文件接口
 * @date 2023/5/25 20:13
 */
@FeignClient(value = "media-api",configuration = {MultipartSupportConfig.class},fallbackFactory = MediaServiceClientFallbackFactory.class)
//@RequestMapping("/checkcode")
public interface MediaServiceClient {
    @PostMapping (value = "/media/upload/coursefile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     String upload(@RequestPart("filedata") MultipartFile filedata,
                                      @RequestParam(value= "objectName",required=false) String objectName) throws IOException ;




}
